package com.yk;

import java.util.LinkedList;

public class LinkedListDemo {
    public static void main(String[] args) {


        LinkedList<String> list = new LinkedList<String>();
        list.addFirst("赵鑫");
        list.addLast("纳");
        list.addLast("居");
        list.addLast("登");
        list.addLast("赵三金");


        String first = list.getFirst();
        System.out.println(first);

        String last = list.getLast();
        System.out.println(last);

        String removeFirst = list.removeFirst();
        System.out.println(removeFirst);
        String removeLast = list.removeLast();
        System.out.println(removeLast);

        System.out.println(list);


    }
}
